import Cookies from 'js-cookie'

const TokenKey = 'Authorization'

export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}

export function setLoginName(loginName) {
  return window.localStorage.setItem('loginName', loginName)
}

export function setLoginPwd(pwd) {
  return window.localStorage.setItem('loginPwd', pwd)
}

export function getLoginName() {
  return window.localStorage.getItem('loginName')
}

export function getLoginPwd() {
  return window.localStorage.getItem('loginPwd')
}
